package com.xiashitech.interfaces.grpc;

import static io.grpc.MethodDescriptor.generateFullMethodName;

/**
 * <pre>
 * 服务接口.定义请求参数和相应结果
 * </pre>
 */
@javax.annotation.Generated(
    value = "by gRPC proto compiler (version 1.58.0)",
    comments = "Source: agent.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class RPCApiInfoServiceGrpc {

  private RPCApiInfoServiceGrpc() {}

  public static final java.lang.String SERVICE_NAME = "com.xiashitech.interfaces.grpc.RPCApiInfoService";

  // Static method descriptors that strictly reflect the proto.
  private static volatile io.grpc.MethodDescriptor<com.xiashitech.interfaces.grpc.RPCApiSyncRequest,
      com.xiashitech.interfaces.grpc.RPCApiSyncResponse> getGrpcApiToOmdStreamMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "grpcApiToOmdStream",
      requestType = com.xiashitech.interfaces.grpc.RPCApiSyncRequest.class,
      responseType = com.xiashitech.interfaces.grpc.RPCApiSyncResponse.class,
      methodType = io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING)
  public static io.grpc.MethodDescriptor<com.xiashitech.interfaces.grpc.RPCApiSyncRequest,
      com.xiashitech.interfaces.grpc.RPCApiSyncResponse> getGrpcApiToOmdStreamMethod() {
    io.grpc.MethodDescriptor<com.xiashitech.interfaces.grpc.RPCApiSyncRequest, com.xiashitech.interfaces.grpc.RPCApiSyncResponse> getGrpcApiToOmdStreamMethod;
    if ((getGrpcApiToOmdStreamMethod = RPCApiInfoServiceGrpc.getGrpcApiToOmdStreamMethod) == null) {
      synchronized (RPCApiInfoServiceGrpc.class) {
        if ((getGrpcApiToOmdStreamMethod = RPCApiInfoServiceGrpc.getGrpcApiToOmdStreamMethod) == null) {
          RPCApiInfoServiceGrpc.getGrpcApiToOmdStreamMethod = getGrpcApiToOmdStreamMethod =
              io.grpc.MethodDescriptor.<com.xiashitech.interfaces.grpc.RPCApiSyncRequest, com.xiashitech.interfaces.grpc.RPCApiSyncResponse>newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "grpcApiToOmdStream"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.xiashitech.interfaces.grpc.RPCApiSyncRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.xiashitech.interfaces.grpc.RPCApiSyncResponse.getDefaultInstance()))
              .setSchemaDescriptor(new RPCApiInfoServiceMethodDescriptorSupplier("grpcApiToOmdStream"))
              .build();
        }
      }
    }
    return getGrpcApiToOmdStreamMethod;
  }

  private static volatile io.grpc.MethodDescriptor<com.xiashitech.interfaces.grpc.RPCApiSyncRequest,
      com.xiashitech.interfaces.grpc.RPCApiSyncResponse> getGrpcApiParamsToOmdStreamMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "grpcApiParamsToOmdStream",
      requestType = com.xiashitech.interfaces.grpc.RPCApiSyncRequest.class,
      responseType = com.xiashitech.interfaces.grpc.RPCApiSyncResponse.class,
      methodType = io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING)
  public static io.grpc.MethodDescriptor<com.xiashitech.interfaces.grpc.RPCApiSyncRequest,
      com.xiashitech.interfaces.grpc.RPCApiSyncResponse> getGrpcApiParamsToOmdStreamMethod() {
    io.grpc.MethodDescriptor<com.xiashitech.interfaces.grpc.RPCApiSyncRequest, com.xiashitech.interfaces.grpc.RPCApiSyncResponse> getGrpcApiParamsToOmdStreamMethod;
    if ((getGrpcApiParamsToOmdStreamMethod = RPCApiInfoServiceGrpc.getGrpcApiParamsToOmdStreamMethod) == null) {
      synchronized (RPCApiInfoServiceGrpc.class) {
        if ((getGrpcApiParamsToOmdStreamMethod = RPCApiInfoServiceGrpc.getGrpcApiParamsToOmdStreamMethod) == null) {
          RPCApiInfoServiceGrpc.getGrpcApiParamsToOmdStreamMethod = getGrpcApiParamsToOmdStreamMethod =
              io.grpc.MethodDescriptor.<com.xiashitech.interfaces.grpc.RPCApiSyncRequest, com.xiashitech.interfaces.grpc.RPCApiSyncResponse>newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "grpcApiParamsToOmdStream"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.xiashitech.interfaces.grpc.RPCApiSyncRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.xiashitech.interfaces.grpc.RPCApiSyncResponse.getDefaultInstance()))
              .setSchemaDescriptor(new RPCApiInfoServiceMethodDescriptorSupplier("grpcApiParamsToOmdStream"))
              .build();
        }
      }
    }
    return getGrpcApiParamsToOmdStreamMethod;
  }

  private static volatile io.grpc.MethodDescriptor<com.xiashitech.interfaces.grpc.RPCDesenseParamRequest,
      com.xiashitech.interfaces.grpc.RPCDesenseParamResponse> getBiSyncApiDesenseMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "biSyncApiDesense",
      requestType = com.xiashitech.interfaces.grpc.RPCDesenseParamRequest.class,
      responseType = com.xiashitech.interfaces.grpc.RPCDesenseParamResponse.class,
      methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
  public static io.grpc.MethodDescriptor<com.xiashitech.interfaces.grpc.RPCDesenseParamRequest,
      com.xiashitech.interfaces.grpc.RPCDesenseParamResponse> getBiSyncApiDesenseMethod() {
    io.grpc.MethodDescriptor<com.xiashitech.interfaces.grpc.RPCDesenseParamRequest, com.xiashitech.interfaces.grpc.RPCDesenseParamResponse> getBiSyncApiDesenseMethod;
    if ((getBiSyncApiDesenseMethod = RPCApiInfoServiceGrpc.getBiSyncApiDesenseMethod) == null) {
      synchronized (RPCApiInfoServiceGrpc.class) {
        if ((getBiSyncApiDesenseMethod = RPCApiInfoServiceGrpc.getBiSyncApiDesenseMethod) == null) {
          RPCApiInfoServiceGrpc.getBiSyncApiDesenseMethod = getBiSyncApiDesenseMethod =
              io.grpc.MethodDescriptor.<com.xiashitech.interfaces.grpc.RPCDesenseParamRequest, com.xiashitech.interfaces.grpc.RPCDesenseParamResponse>newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "biSyncApiDesense"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.xiashitech.interfaces.grpc.RPCDesenseParamRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.xiashitech.interfaces.grpc.RPCDesenseParamResponse.getDefaultInstance()))
              .setSchemaDescriptor(new RPCApiInfoServiceMethodDescriptorSupplier("biSyncApiDesense"))
              .build();
        }
      }
    }
    return getBiSyncApiDesenseMethod;
  }

  /**
   * Creates a new async stub that supports all call types for the service
   */
  public static RPCApiInfoServiceStub newStub(io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory<RPCApiInfoServiceStub> factory =
      new io.grpc.stub.AbstractStub.StubFactory<RPCApiInfoServiceStub>() {
        @java.lang.Override
        public RPCApiInfoServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new RPCApiInfoServiceStub(channel, callOptions);
        }
      };
    return RPCApiInfoServiceStub.newStub(factory, channel);
  }

  /**
   * Creates a new blocking-style stub that supports unary and streaming output calls on the service
   */
  public static RPCApiInfoServiceBlockingStub newBlockingStub(
      io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory<RPCApiInfoServiceBlockingStub> factory =
      new io.grpc.stub.AbstractStub.StubFactory<RPCApiInfoServiceBlockingStub>() {
        @java.lang.Override
        public RPCApiInfoServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new RPCApiInfoServiceBlockingStub(channel, callOptions);
        }
      };
    return RPCApiInfoServiceBlockingStub.newStub(factory, channel);
  }

  /**
   * Creates a new ListenableFuture-style stub that supports unary calls on the service
   */
  public static RPCApiInfoServiceFutureStub newFutureStub(
      io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory<RPCApiInfoServiceFutureStub> factory =
      new io.grpc.stub.AbstractStub.StubFactory<RPCApiInfoServiceFutureStub>() {
        @java.lang.Override
        public RPCApiInfoServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new RPCApiInfoServiceFutureStub(channel, callOptions);
        }
      };
    return RPCApiInfoServiceFutureStub.newStub(factory, channel);
  }

  /**
   * <pre>
   * 服务接口.定义请求参数和相应结果
   * </pre>
   */
  public interface AsyncService {

    /**
     * <pre>
     * agent 端多次推送数据到服务端，服务端无需响应，为不引入 Empty 类，定义了 Response
     * </pre>
     */
    default io.grpc.stub.StreamObserver<com.xiashitech.interfaces.grpc.RPCApiSyncRequest> grpcApiToOmdStream(
        io.grpc.stub.StreamObserver<com.xiashitech.interfaces.grpc.RPCApiSyncResponse> responseObserver) {
      return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getGrpcApiToOmdStreamMethod(), responseObserver);
    }

    /**
     * <pre>
     * agent 端多次推送数据到服务端，服务端无需响应，为不引入 Empty 类，定义了 Response
     * </pre>
     */
    default io.grpc.stub.StreamObserver<com.xiashitech.interfaces.grpc.RPCApiSyncRequest> grpcApiParamsToOmdStream(
        io.grpc.stub.StreamObserver<com.xiashitech.interfaces.grpc.RPCApiSyncResponse> responseObserver) {
      return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getGrpcApiParamsToOmdStreamMethod(), responseObserver);
    }

    /**
     * <pre>
     * 客户端多次提交，服务端处理正确即可，没有服务端推送
     * </pre>
     */
    default io.grpc.stub.StreamObserver<com.xiashitech.interfaces.grpc.RPCDesenseParamRequest> biSyncApiDesense(
        io.grpc.stub.StreamObserver<com.xiashitech.interfaces.grpc.RPCDesenseParamResponse> responseObserver) {
      return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getBiSyncApiDesenseMethod(), responseObserver);
    }
  }

  /**
   * Base class for the server implementation of the service RPCApiInfoService.
   * <pre>
   * 服务接口.定义请求参数和相应结果
   * </pre>
   */
  public static abstract class RPCApiInfoServiceImplBase
      implements io.grpc.BindableService, AsyncService {

    @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
      return RPCApiInfoServiceGrpc.bindService(this);
    }
  }

  /**
   * A stub to allow clients to do asynchronous rpc calls to service RPCApiInfoService.
   * <pre>
   * 服务接口.定义请求参数和相应结果
   * </pre>
   */
  public static final class RPCApiInfoServiceStub
      extends io.grpc.stub.AbstractAsyncStub<RPCApiInfoServiceStub> {
    private RPCApiInfoServiceStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected RPCApiInfoServiceStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new RPCApiInfoServiceStub(channel, callOptions);
    }

    /**
     * <pre>
     * agent 端多次推送数据到服务端，服务端无需响应，为不引入 Empty 类，定义了 Response
     * </pre>
     */
    public io.grpc.stub.StreamObserver<com.xiashitech.interfaces.grpc.RPCApiSyncRequest> grpcApiToOmdStream(
        io.grpc.stub.StreamObserver<com.xiashitech.interfaces.grpc.RPCApiSyncResponse> responseObserver) {
      return io.grpc.stub.ClientCalls.asyncClientStreamingCall(
          getChannel().newCall(getGrpcApiToOmdStreamMethod(), getCallOptions()), responseObserver);
    }

    /**
     * <pre>
     * agent 端多次推送数据到服务端，服务端无需响应，为不引入 Empty 类，定义了 Response
     * </pre>
     */
    public io.grpc.stub.StreamObserver<com.xiashitech.interfaces.grpc.RPCApiSyncRequest> grpcApiParamsToOmdStream(
        io.grpc.stub.StreamObserver<com.xiashitech.interfaces.grpc.RPCApiSyncResponse> responseObserver) {
      return io.grpc.stub.ClientCalls.asyncClientStreamingCall(
          getChannel().newCall(getGrpcApiParamsToOmdStreamMethod(), getCallOptions()), responseObserver);
    }

    /**
     * <pre>
     * 客户端多次提交，服务端处理正确即可，没有服务端推送
     * </pre>
     */
    public io.grpc.stub.StreamObserver<com.xiashitech.interfaces.grpc.RPCDesenseParamRequest> biSyncApiDesense(
        io.grpc.stub.StreamObserver<com.xiashitech.interfaces.grpc.RPCDesenseParamResponse> responseObserver) {
      return io.grpc.stub.ClientCalls.asyncBidiStreamingCall(
          getChannel().newCall(getBiSyncApiDesenseMethod(), getCallOptions()), responseObserver);
    }
  }

  /**
   * A stub to allow clients to do synchronous rpc calls to service RPCApiInfoService.
   * <pre>
   * 服务接口.定义请求参数和相应结果
   * </pre>
   */
  public static final class RPCApiInfoServiceBlockingStub
      extends io.grpc.stub.AbstractBlockingStub<RPCApiInfoServiceBlockingStub> {
    private RPCApiInfoServiceBlockingStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected RPCApiInfoServiceBlockingStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new RPCApiInfoServiceBlockingStub(channel, callOptions);
    }
  }

  /**
   * A stub to allow clients to do ListenableFuture-style rpc calls to service RPCApiInfoService.
   * <pre>
   * 服务接口.定义请求参数和相应结果
   * </pre>
   */
  public static final class RPCApiInfoServiceFutureStub
      extends io.grpc.stub.AbstractFutureStub<RPCApiInfoServiceFutureStub> {
    private RPCApiInfoServiceFutureStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected RPCApiInfoServiceFutureStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new RPCApiInfoServiceFutureStub(channel, callOptions);
    }
  }

  private static final int METHODID_GRPC_API_TO_OMD_STREAM = 0;
  private static final int METHODID_GRPC_API_PARAMS_TO_OMD_STREAM = 1;
  private static final int METHODID_BI_SYNC_API_DESENSE = 2;

  private static final class MethodHandlers<Req, Resp> implements
      io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
    private final AsyncService serviceImpl;
    private final int methodId;

    MethodHandlers(AsyncService serviceImpl, int methodId) {
      this.serviceImpl = serviceImpl;
      this.methodId = methodId;
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("unchecked")
    public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
      switch (methodId) {
        default:
          throw new AssertionError();
      }
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("unchecked")
    public io.grpc.stub.StreamObserver<Req> invoke(
        io.grpc.stub.StreamObserver<Resp> responseObserver) {
      switch (methodId) {
        case METHODID_GRPC_API_TO_OMD_STREAM:
          return (io.grpc.stub.StreamObserver<Req>) serviceImpl.grpcApiToOmdStream(
              (io.grpc.stub.StreamObserver<com.xiashitech.interfaces.grpc.RPCApiSyncResponse>) responseObserver);
        case METHODID_GRPC_API_PARAMS_TO_OMD_STREAM:
          return (io.grpc.stub.StreamObserver<Req>) serviceImpl.grpcApiParamsToOmdStream(
              (io.grpc.stub.StreamObserver<com.xiashitech.interfaces.grpc.RPCApiSyncResponse>) responseObserver);
        case METHODID_BI_SYNC_API_DESENSE:
          return (io.grpc.stub.StreamObserver<Req>) serviceImpl.biSyncApiDesense(
              (io.grpc.stub.StreamObserver<com.xiashitech.interfaces.grpc.RPCDesenseParamResponse>) responseObserver);
        default:
          throw new AssertionError();
      }
    }
  }

  public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) {
    return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
        .addMethod(
          getGrpcApiToOmdStreamMethod(),
          io.grpc.stub.ServerCalls.asyncClientStreamingCall(
            new MethodHandlers<
              com.xiashitech.interfaces.grpc.RPCApiSyncRequest,
              com.xiashitech.interfaces.grpc.RPCApiSyncResponse>(
                service, METHODID_GRPC_API_TO_OMD_STREAM)))
        .addMethod(
          getGrpcApiParamsToOmdStreamMethod(),
          io.grpc.stub.ServerCalls.asyncClientStreamingCall(
            new MethodHandlers<
              com.xiashitech.interfaces.grpc.RPCApiSyncRequest,
              com.xiashitech.interfaces.grpc.RPCApiSyncResponse>(
                service, METHODID_GRPC_API_PARAMS_TO_OMD_STREAM)))
        .addMethod(
          getBiSyncApiDesenseMethod(),
          io.grpc.stub.ServerCalls.asyncBidiStreamingCall(
            new MethodHandlers<
              com.xiashitech.interfaces.grpc.RPCDesenseParamRequest,
              com.xiashitech.interfaces.grpc.RPCDesenseParamResponse>(
                service, METHODID_BI_SYNC_API_DESENSE)))
        .build();
  }

  private static abstract class RPCApiInfoServiceBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
    RPCApiInfoServiceBaseDescriptorSupplier() {}

    @java.lang.Override
    public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
      return com.xiashitech.interfaces.grpc.RPCAgentServiceApi.getDescriptor();
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
      return getFileDescriptor().findServiceByName("RPCApiInfoService");
    }
  }

  private static final class RPCApiInfoServiceFileDescriptorSupplier
      extends RPCApiInfoServiceBaseDescriptorSupplier {
    RPCApiInfoServiceFileDescriptorSupplier() {}
  }

  private static final class RPCApiInfoServiceMethodDescriptorSupplier
      extends RPCApiInfoServiceBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
    private final java.lang.String methodName;

    RPCApiInfoServiceMethodDescriptorSupplier(java.lang.String methodName) {
      this.methodName = methodName;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
      return getServiceDescriptor().findMethodByName(methodName);
    }
  }

  private static volatile io.grpc.ServiceDescriptor serviceDescriptor;

  public static io.grpc.ServiceDescriptor getServiceDescriptor() {
    io.grpc.ServiceDescriptor result = serviceDescriptor;
    if (result == null) {
      synchronized (RPCApiInfoServiceGrpc.class) {
        result = serviceDescriptor;
        if (result == null) {
          serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
              .setSchemaDescriptor(new RPCApiInfoServiceFileDescriptorSupplier())
              .addMethod(getGrpcApiToOmdStreamMethod())
              .addMethod(getGrpcApiParamsToOmdStreamMethod())
              .addMethod(getBiSyncApiDesenseMethod())
              .build();
        }
      }
    }
    return result;
  }
}
